<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
namespace app\card\info;

class PermissionCard extends \longbingcore\permissions\PermissionAbstract
{
    public $saasKey;
    const tabbarKey = NULL;
    const adminMenuKey = "card";
    const apiPaths = [];
    public function __construct(int $uniacid, $infoConfigOptions = [])
    {
        $this->saasKey = longbing_get_auth_prefix("AUTH_CARD");
        parent::__construct($uniacid, self::tabbarKey, self::adminMenuKey, $this->saasKey, self::apiPaths, $infoConfigOptions);
    }
    public function sAuth()
    {
        return true;
    }
    public function pAuth()
    {
        return true;
    }
    public function cAuth($user_id)
    {
        return true;
    }
    public function getAuthNumber()
    {
        $returnAuthNumber = -1;
        $pAuthConfig = $this->getPAuthConfig();
        $authCardNumber = $this->getAuthVaule($this->saasKey, 5);
        $pAuthNumber = isset($pAuthConfig["number"]) ? $pAuthConfig["number"] : -1;
        $cardauth2DefaultModel = new \app\agent\model\Cardauth2DefaultModel();
        $defaultAuthNumber = $cardauth2DefaultModel->getCardNumber();
        if(0 < $authCardNumber) {
            if(0 < $pAuthNumber) {
                $returnAuthNumber = $authCardNumber <= $pAuthNumber ? $authCardNumber : $pAuthNumber;
            } else {
                $returnAuthNumber = $authCardNumber;
            }
        } elseif($authCardNumber == 0) {
            if(0 <= $pAuthNumber) {
                $returnAuthNumber = $pAuthNumber;
            } elseif(0 <= $defaultAuthNumber) {
                $returnAuthNumber = $defaultAuthNumber;
            } else {
                $returnAuthNumber = $pAuthNumber;
            }
        } else {
            $returnAuthNumber = $pAuthNumber;
        }
        return $returnAuthNumber;
    }
}

?>